import request from '@/utils/request'

import {tokenName } from '@/config'

// 登录
export async function login(data) {

  return request({
    url: 'common/login',
    method: 'post',
    data,
    headers:{
      'showLoading':false
    }
  })
}
//获取用户信息
export function getUserInfo(accessToken) {
  return request({
    url: 'common/userInfo',
    method: 'get',
    params: { accessToken }
  })
}

// 退出登录
export function logout() {
  return request({
    url: 'common/loginOut',
    method: 'post',
    headers:{
      'showLoading':false
    }
  })
}

//验证码登录
export function smsLogin(data){
  return request({
    url: 'common/login',
    method: 'post',
    data,
    headers:{
      'showLoading':true
    }
  })
}
